//
//  LYQMineTopicManageNumberCell.m
//  ZCProject
//
//  Created by Zheng on 16/12/5.
//  Copyright © 2016年 Zheng. All rights reserved.
//

#import "LYQMineTopicManageNumberCell.h"

@implementation LYQMineTopicManageNumberCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self == nil) {
        return nil;
    }

    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    [self.contentView addSubview:self.cNumberView];
    [self.contentView addSubview:self.gNumberView];
    [self.contentView addSubview:self.lineView];
    
    [self layoutSubviewsInContentView];
    
    return self;
}

#pragma mark - layout subviews
- (void)layoutSubviewsInContentView {
    
    [_cNumberView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.equalTo(self);
        make.width.equalTo(@((kMS_Width-0.5)/2));
    }];
    
    [_lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_cNumberView.mas_right);
        make.top.bottom.equalTo(self);
        make.width.equalTo(@(0.5));
    }];
    
    [_gNumberView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_lineView.mas_right);
        make.top.bottom.right.equalTo(self);
    }];
    
}

#pragma mark - load subviews
- (UIButton *)cNumberView {
    
    if (_cNumberView) {
        return _cNumberView;
    }
    
    _cNumberView = [UIButton buttonWithType:UIButtonTypeCustom];
    _cNumberView.enabled = NO;
    [_cNumberView setImage:[UIImage imageNamed:@"skgwicon"] forState:UIControlStateNormal];
    [_cNumberView setTitle:@"100人参与" forState:UIControlStateNormal];
    [_cNumberView setTitleColor:kHexadecimal(@"666666") forState:UIControlStateNormal];
    [_cNumberView setTitleEdgeInsets:UIEdgeInsetsMake(0, 7, 0, 0)];
    _cNumberView.titleLabel.font = kWFont(15);
    
    return _cNumberView;
}

- (UIButton *)gNumberView {
    
    if (_gNumberView) {
        return _gNumberView;
    }
    
    _gNumberView = [UIButton buttonWithType:UIButtonTypeCustom];
    _gNumberView.enabled = NO;
    [_gNumberView setImage:[UIImage imageNamed:@"skgwicon"] forState:UIControlStateNormal];
    [_gNumberView setTitle:@"15人观点" forState:UIControlStateNormal];
    [_gNumberView setTitleColor:kHexadecimal(@"666666") forState:UIControlStateNormal];
    [_gNumberView setTitleEdgeInsets:UIEdgeInsetsMake(0, 7, 0, 0)];
    _gNumberView.titleLabel.font = kWFont(15);
    
    return _gNumberView;
}

- (UIView *)lineView {
    
    if (_lineView) {
        return _lineView;
    }
    
    _lineView = [[UIView alloc] init];
    _lineView.backgroundColor = RGB(200, 199, 204, 1);
    
    return _lineView;
}

@end
